<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/4/22
  Time: 22:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主界面</title>
</head>
<body>
<%
    String username1 = (String) session.getAttribute("userName1");
    if (username1 == null) {
        request.setCharacterEncoding("UTF-8");
        String username = request.getParameter("userName");
        if (username == null)
            response.sendRedirect("index.jsp");
        else {
            session.setAttribute("userName1", username);
            out.println(username + "!欢迎您来到主页面，请选择您要购买的商品：");
        }
    } else {
        out.println(username1 + "!欢迎您来到主页面，请选择您要购买的商品：");
    }
%>
<form action="index03.jsp" method="post">
    <p>商品信息</p>
    <table border="1">
        <tr>
            <td><input type="checkbox" name="choice" value="U盘"></td>
            <td>U盘</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="choice" value="移动硬盘"></td>
            <td>移动硬盘</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="choice" value="鼠标"></td>
            <td>鼠标</td>
        </tr>
        <tr>
            <td><input type="checkbox" name="choice" value="键盘"></td>
            <td>键盘</td>
        </tr>
    </table>
    <input type="submit" value="增加购物车">
</form>
</body>
</html>
